﻿<!-- #Include File="../Include/Function.asp" -->
<!-- #Include File="../Include/Md5.asp" -->
<%
Tit="后台管理系统"

Select Case Action
Case "Login"
    Call ChkLogin()
Case "Logout"
    Call Logout()
Case Else
    Call Admin_Login()
End Select
If FoundErr = True Then
	Call WriteErrMsg(ErrMsg, ComeUrl)
End If
Call CloseConn()

Sub Admin_Login()
	If Cookies_Get(Cookies_For&"Admin") = "GongXiang_Admin" And Cookies_Get(Cookies_For&"AdminUserName") <> "" And Cookies_Get(Cookies_For&"AdminPassword") <> "" And Cookies_Get(Cookies_For&"AdminRndPassword") <> "" Or (Web_AdminCodes <> "" And Cookies_Get(Cookies_For&"AdminLoginCode") = Web_AdminCodes) Then
		Call Format_Redirect("Admin_Index.asp")
	End If
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<html lang=""zh-cn"" >" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" />" & vbCrLf
	Response.Write "<meta content=""width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"" name=""viewport""/>" & vbCrLf
	Response.Write "<meta content=""IE=edge,chrome=1"" http-equiv=""X-UA-Compatible""/>" & vbCrLf
	Response.Write "<meta name=""renderer"" content=""webkit""/>" & vbCrLf
	Response.Write "<meta name=""HandheldFriendly"" content=""true""/>" & vbCrLf
	Response.Write "<meta name=""format-detection"" content=""telephone=no, email=no"" />" & vbCrLf
	Response.Write "<title>"&SiteName&" - "&Tit&"</title>" & vbCrLf
	Response.Write "<link rel=""shortcut icon"" href=""Images/favicon.ico"" />" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""Plugins/layui/css/layui.css"" />" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""Style/global.css"" />" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""Style/login.css"" />" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""Style/font.css"" />" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""Js/Admin.js""></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Dialog/main.js""></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""Plugins/layui/layui.js""></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src="""&InstallDir&"Style/KeyBoard.js""></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"">" & vbCrLf
	Response.Write "if(self.parent.frames.length!=0){" & vbCrLf
	Response.Write "self.parent.location=document.location.href;" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "var CloseStr=0;" & vbCrLf
	Response.Write "$(document).ready(function() {" & vbCrLf
	Response.Write "if(document.getElementById('UserName').value == '') {" & vbCrLf
	Response.Write "document.getElementById('UserName').focus();" & vbCrLf
	Response.Write "} else {" & vbCrLf
	Response.Write "document.getElementById('UserName').select();" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "var a=navigator.userAgent.toLowerCase();" & vbCrlf
	Response.Write "isLiebao=/lbbrowser/i.test(a);" & vbCrlf
	Response.Write "is360Old=false;try{if(window.external&&external.twGetRunPath&&external.twGetRunPath().match(/360\we/i)){is360Old=true}}catch(d){}" & vbCrlf
	Response.Write "ieVersion=/msie|trident/.test(a)?parseFloat(/(msie |rv:)([\w.]+)/.exec(a)[2]):null;" & vbCrlf
	Response.Write "isIE=/msie/.test(a)&&!!window.ActiveXObject;" & vbCrlf
	Response.Write "if(isIE && ieVersion<10){" & vbCrlf
	Response.Write "var ie={" & vbCrlf
	Response.Write "'6':{" & vbCrlf
	Response.Write "y: new Date().getFullYear() - 2001" & vbCrlf
	Response.Write "}," & vbCrlf
	Response.Write "'7':{" & vbCrlf
	Response.Write "y: new Date().getFullYear() - 2006" & vbCrlf
	Response.Write "}," & vbCrlf
	Response.Write "'8':{" & vbCrlf
	Response.Write "y: new Date().getFullYear() - 2008" & vbCrlf
	Response.Write "}," & vbCrlf
	Response.Write "'9':{" & vbCrlf
	Response.Write "y: new Date().getFullYear() - 2011" & vbCrlf
	Response.Write "}," & vbCrlf
	Response.Write "'10':{" & vbCrlf
	Response.Write "y: new Date().getFullYear() - 2012" & vbCrlf
	Response.Write "}," & vbCrlf
	Response.Write "'11':{" & vbCrlf
	Response.Write "y: new Date().getFullYear() - 2013" & vbCrlf
	Response.Write "}" & vbCrlf
	Response.Write "}" & vbCrlf
	Response.Write "var msg;" & vbCrlf
	Response.Write "if(Lang.getCurrentLang()=='en'){" & vbCrlf
	Response.Write "msg='Find that you are using IE'+ieVersion+', the browser was released in '+ie[''+ieVersion].y+' years ago, the script execution is very low in it, We suggest you install a newer browsers to get the better operation experience.<br>'" & vbCrlf
	Response.Write "msg+='<br> download <a target=""_blank"" href=""http://browser.360.cn/"">360se</a>';" & vbCrlf
	Response.Write "msg+='&nbsp; download <a target=""_blank"" href=""http://ie.sogou.com/"">SogouExplorer</a>';" & vbCrlf
	Response.Write "msg+='&nbsp; download <a target=""_blank"" href=""http://www.firefox.com.cn/download/"">firefox</a>';" & vbCrlf
	Response.Write "msg+='&nbsp; download <a target=""_blank"" href=""http://windows.microsoft.com/zh-cn/internet-explorer/downloads/ie-10/"">IE10</a>';" & vbCrlf
	Response.Write "}else{" & vbCrlf
	Response.Write "msg='向您致以歉意：<br>　　发现您正在使用IE'+ieVersion+'浏览器，此浏览器已发布'+ie[''+ieVersion].y+'年，性能和兼容性较差，在此浏览器下本系统运行较慢。建议您安装最新的浏览器以获得流畅的使用体验。<br>';" & vbCrlf
	Response.Write "msg+='<br> 下载<a target=""_blank"" href=""http://browser.360.cn/"">360浏览器</a>';" & vbCrlf
	Response.Write "msg+='&nbsp; 下载<a target=""_blank"" href=""http://ie.sogou.com/"">搜狗高速浏览器</a>';" & vbCrlf
	Response.Write "msg+='&nbsp; 下载<a target=""_blank"" href=""http://www.firefox.com.cn/download/"">火狐浏览器</a>';" & vbCrlf
	Response.Write "msg+='&nbsp; 下载<a target=""_blank"" href=""http://windows.microsoft.com/zh-cn/internet-explorer/downloads/ie-10/"">微软IE10</a>';" & vbCrlf
	Response.Write "}" & vbCrlf
	Response.Write "new Dialog({" & vbCrlf
	Response.Write "html:msg," & vbCrlf
	Response.Write "width:500," & vbCrlf
	'Response.Write "left:'51%'," & vbCrlf
	'Response.Write "top:'40%'," & vbCrlf
	'Response.Write "modal:false" & vbCrlf
	Response.Write "modal:true" & vbCrlf
	Response.Write "}).show();" & vbCrlf
	Response.Write "//$('#loginBar').html(msg);" & vbCrlf
	Response.Write "//$('#loginBar').css(""padding-top"",""90px"");" & vbCrlf
	Response.Write "}" & vbCrlf
	Response.Write "if(isIE && isLiebao){" & vbCrlf
	Response.Write "Dialog.alert('发现你正在使用猎豹浏览器的IE兼容模式，请在页面空白处点击右键并选择“切换到极速模式”，以获得更好的用户体验。')" & vbCrlf
	Response.Write "}" & vbCrlf
	Response.Write "if(is360Old){" & vbCrlf
	Response.Write "Dialog.alert('发现你正在使用低版本的360浏览器，请使用最新的360浏览器，以获得更好的用户体验。')" & vbCrlf
	Response.Write "}" & vbCrlf
	Response.Write "if (!Cookie.get(""skin"")) {" & vbCrlf
	Response.Write "Cookie.set(""skin"", $V('skin'), 60 * 60 * 24 * 100);" & vbCrlf
	Response.Write "}" & vbCrlf
	Response.Write "Selector.setValue('skin', Cookie.get(""skin"").toLowerCase(), null, true);" & vbCrlf
	Response.Write "$S('skin', Cookie.get(""skin"").toLowerCase());" & vbCrlf
	Response.Write "});" & vbCrLf
	Response.Write "function Voice() {" & vbCrLf
	Response.Write "document.getElementById('Voices').innerHTML='<audio id=""audio"" controls=""controls"" autoplay=""autoplay""><source src=""Include/Voice.asp?'+Math.random()+'"" type=""audio/mpeg""></audio>'" & vbCrLf
	Response.Write "document.getElementById('audio').play();" & vbCrLf
	Response.Write "document.getElementById('GetCode').value='';" & vbCrLf
	Response.Write "document.getElementById('GetCode').focus();" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "function onSkinChange() {" & vbCrLf
	Response.Write "Cookie.set(""skin"", $V('skin'), 60 * 60 * 24 * 100);" & vbCrLf
	Response.Write "Config.skin = $V('skin');" & vbCrLf
	Response.Write "window.location.reload();" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "</head>" & vbCrLf
	Response.Write "<body>" & vbCrLf
	Response.Write "<!--[if lt IE 10]>" & vbCrLf
	Response.Write "<div style=""display:none"">" & vbCrLf
	Response.Write "<![endif]-->" & vbCrLf
	Response.Write "<div class=""large-header"">" & vbCrLf
	Response.Write "    <div id=""login"">" & vbCrLf
	Response.Write "        <h1>" & vbCrLf
	Response.Write "	    	 <strong>开心网络管理系统后台</strong>" & vbCrLf
	Response.Write "	    	 <em class=""en-font"">Management System</em>" & vbCrLf
	Response.Write "	    </h1>" & vbCrLf
	Response.Write "        <div class=""user info"">" & vbCrLf
	Response.Write "            <label class='beg-login-icon fs1'>" & vbCrLf
	Response.Write "                <span class='fa fa-user'></span>" & vbCrLf
	Response.Write "            </label>" & vbCrLf
	Response.Write "            <input type=""text"" name=""UserName"" value="""" id=""UserName"" class=""en-font"" placeholder=""账号"" autocomplete=""off"" onFocus='this.focused=true;this.select();' onmouseup='if(this.focused){this.focused=false;return false;}'>" & vbCrLf
	Response.Write "        </div>" & vbCrLf
	Response.Write "        <div class=""pwd info"">" & vbCrLf
	Response.Write "            <label class='beg-login-icon fs1'>" & vbCrLf
	Response.Write "                <span class='fa fa-lock'></span>" & vbCrLf
	Response.Write "            </label>" & vbCrLf
	If EnableSoftKey=True Then
		Response.Write "            <input type=""password"" name=""UserPassword"" value="""" id=""UserPassword"" class=""en-font"" placeholder=""密码"" autocomplete=""off"" readonly=""readonly"" onFocus='this.focused=true;this.select();' onmouseup='if(this.focused){this.focused=false;return false;}' onClick=""CheckKeyBoard(this,event);"">" & vbCrLf
	Else
		Response.Write "            <input type=""password"" name=""UserPassword"" value="""" id=""UserPassword"" class=""en-font"" placeholder=""密码"" autocomplete=""off"" onFocus='this.focused=true;this.select();' onmouseup='if(this.focused){this.focused=false;return false;}'>" & vbCrLf
	End If
	Response.Write "        </div>" & vbCrLf
	If Is_Null(Web_AdminCodes)<>"" Then
		Response.Write "        <div class=""pwd info"">" & vbCrLf
		Response.Write "            <label class='beg-login-icon fs1'>" & vbCrLf
		Response.Write "                <span class='icon icon-key'></span>" & vbCrLf
		Response.Write "            </label>" & vbCrLf
		Response.Write "            <input type=""password"" name=""AdminLoginCode"" value="""" id=""AdminLoginCode"" class=""en-font"" placeholder=""管理认证码"" autocomplete=""off"" onFocus='this.focused=true;this.select();' onmouseup='if(this.focused){this.focused=false;return false;}'>" & vbCrLf
		Response.Write "        </div>" & vbCrLf
	End If
	Response.Write "        <div class=""code info"">" & vbCrLf
	Response.Write "            <label class='beg-login-icon fs1'>" & vbCrLf
	Response.Write "                <span class='icon icon-eye'></span>" & vbCrLf
	Response.Write "            </label>" & vbCrLf
	Response.Write "            <input type=""text"" name=""GetCode"" value="""" id=""GetCode"" class=""en-font"" autocomplete=""off"" placeholder=""验证码"" maxlength=""4"" onFocus='this.focused=true;this.select();' onmouseup='if(this.focused){this.focused=false;return false;}'>" & vbCrLf
	Response.Write "            <span class=""vimg""><img src=""Include/GetCode.asp?n="&Timer&""" id=""captchaimg"" onmouseover=""layer.tips('验证码，看不清楚？请点击刷新验证码并听取语音验证码',this,{tips: [1, '#000']});"" onmouseout=""layer.closeAll();"" onclick=""this.src=this.src+Math.random();Voice();""/></span>" & vbCrLf
	Response.Write "        </div>" & vbCrLf
	Response.Write "        <div class=""code login-form-item"">" & vbCrLf
	Response.Write "            <div id=""skin_outer"" ztype=""select"" class=""z-combox"" style=""display:inline-block; *zoom: 1;*display: inline;vertical-align:middle;height:auto;width:auto;position:relative;border:none 0;margin:0;padding:0;white-space: nowrap;"" _style=""height:28px;width:260px;""><input type=""text"" ztype=""select"" id=""skin"" name=""skin"" tabindex=""-1"" autocomplete=""off"" class=""inputText"" style=""height:28px;width:260px;position:absolute;z-index:-1;"" onchange=""onSkinChange()"" listwidth=""268"" code=""Theme"" value="""" startvalue=""""/><input type=""text"" id=""skin_textField"" autocomplete=""off"" class=""inputText"" style=""vertical-align:middle; cursor:default;height:28px;width:260px;"" /><a id=""skin_spinner"" class=""z-combox-spinner"" style=""position:relative; left:-17px; margin-right:-15px; cursor:pointer; width:13px; height:15px;vertical-align:middle;""><b></b></a><div id=""skin_list"" class=""optgroup"" style=""text-align:left;display:none;""><div id=""skin_ul"" style=""left:-1px; width:-1px;""><script>Combox_skin_Init=function(){var _el=Zving.getDom('skin');if(_el._components){return true;}var  _data=[];var  _DataSource;_data.push(['','默认主题']);_data.push(['zvingclassic','经典蓝色']);_data.push(['zvinggreen','清新绿色']);_data.push(['zvingdeep','雅致深色']);_data.push(['zvingred','庄重红色']);_data.push(['zvingpurple','优雅紫色']);_data.push(['zvingflat','明快扁平']);var combox_skin = new Zving.Selector({el:_el,data:_data,DataSource:_DataSource});};if(Zving.Page.isReady){Combox_skin_Init();}else{Zving.Page.onReady(Combox_skin_Init);}</script></div></div></div>" & vbCrLf
	Response.Write "        </div>" & vbCrLf
	Response.Write "        <div class=""sub"">" & vbCrLf
	Response.Write "            <input type=""submit"" id=""LoginSubmit"" class=""login-btn"" value=""立即登录""/>" & vbCrLf
	Response.Write "        </div>" & vbCrLf
	Response.Write "        <div class=""copy"">Copyright&nbsp;&copy;&nbsp;www.kaixin100.cn</div>" & vbCrLf
	Response.Write "    </div>" & vbCrLf
	Response.Write "</div>" & vbCrLf
	Response.Write "<div class=""auth"">" & vbCrLf
	Response.Write "    <div class=""loading""><div class=""loader-inner ball-clip-rotate-multiple""></div></div>" & vbCrLf
	Response.Write "    <p>验证中...</p>" & vbCrLf
	Response.Write "</div>" & vbCrLf
	Response.Write "<div id=""Voices"" style=""width: 0px; height: 0px; overflow:hidden; text-indent:-99999px;""></div>" & vbCrLf
	Response.Write "<script type=""text/javascript"">" & vbCrLf
	Response.Write "layui.use(['layer'],function(){" & vbCrLf
	Response.Write "    var layer=layui.layer;" & vbCrLf
	Response.Write "});" & vbCrLf
	Response.Write "$('body').keydown(function(e){" & vbCrLf
	Response.Write "    if (e.keyCode == 13) {" & vbCrLf
	Response.Write "        $('#LoginSubmit').trigger('click') ;" & vbCrLf
	Response.Write "    }" & vbCrLf
	Response.Write "})" & vbCrLf
	Response.Write "$('#LoginSubmit').click(function(){" & vbCrLf
	Response.Write "    layer.closeAll();" & vbCrLf
	Response.Write "    var UserName = $.trim($('#UserName').val());" & vbCrLf
	Response.Write "    if (!UserName) {" & vbCrLf
	Response.Write "        layer.msg('请填写用户名！', {icon: 5, anim: 6, time: 1000});" & vbCrLf
	Response.Write "        $('#UserName').focus();" & vbCrLf
	Response.Write "        return false;" & vbCrLf
	Response.Write "    }" & vbCrLf
	Response.Write "    var UserPassword = $.trim($('#UserPassword').val());" & vbCrLf
	Response.Write "    if (!UserPassword) {" & vbCrLf
	Response.Write "        layer.msg('请填写密码！', {icon: 5, anim: 6, time: 1000});" & vbCrLf
	Response.Write "        if ($('#UserPassword').attr('readonly')=='readonly') {" & vbCrLf
	Response.Write "            $('#UserPassword').trigger('click');" & vbCrLf
	Response.Write "        } else {" & vbCrLf
	Response.Write "            $('#UserPassword').focus();" & vbCrLf
	Response.Write "        }" & vbCrLf
	Response.Write "        return false;" & vbCrLf
	Response.Write "    }" & vbCrLf
	If Is_Null(Web_AdminCodes)<>"" Then
		Response.Write "    var AdminLoginCode = $.trim($('#AdminLoginCode').val());" & vbCrLf
		Response.Write "    if (!AdminLoginCode) {" & vbCrLf
		Response.Write "        layer.msg('请填写管理认证码！', {icon: 5, anim: 6, time: 1000});" & vbCrLf
		Response.Write "        $('#AdminLoginCode').focus();" & vbCrLf
		Response.Write "        return false;" & vbCrLf
		Response.Write "    }" & vbCrLf
	End If
	Response.Write "    var GetCode = $.trim($('#GetCode').val());" & vbCrLf
	Response.Write "    if (!GetCode) {" & vbCrLf
	Response.Write "        layer.msg('请填写验证码！', {icon: 5, anim: 6, time: 1000});" & vbCrLf
	Response.Write "        $('#GetCode').focus();" & vbCrLf
	Response.Write "        return false;" & vbCrLf
	Response.Write "    }" & vbCrLf
	Response.Write "    $('#login').addClass('checking');" & vbCrLf
	Response.Write "    setTimeout(function(){" & vbCrLf
	Response.Write "        $('#login').animate({" & vbCrLf
	Response.Write "            'margin-left' : -450" & vbCrLf
	Response.Write "        }, 200, 'easeOutQuint')" & vbCrLf
	Response.Write "        $('.auth').addClass('checking');" & vbCrLf
	Response.Write "    }, 500)" & vbCrLf
	Response.Write "    setTimeout(function(){" & vbCrLf
	Response.Write "        $.post(""Admin_Login.asp?Action=Login"",{" & vbCrLf
	Response.Write "            UserName : UserName," & vbCrLf
	Response.Write "            UserPassword : UserPassword," & vbCrLf
	If Is_Null(Web_AdminCodes)<>"" Then
		Response.Write "            AdminLoginCode : AdminLoginCode," & vbCrLf
	End If
	Response.Write "            GetCode : GetCode" & vbCrLf
	Response.Write "        }, function(data){" & vbCrLf
	Response.Write "            var json = $.parseJSON(data);" & vbCrLf
	Response.Write "            if (json['code'] == 1) {" & vbCrLf
	Response.Write "                layer.msg(json['msg'], {icon: 1, time: 1000});" & vbCrLf
	Response.Write "                setTimeout(function(){" & vbCrLf
	Response.Write "                    location.href = json['url'];" & vbCrLf
	Response.Write "                }, 800)" & vbCrLf
	Response.Write "            } else if (json['code'] == 2) {" & vbCrLf
	Response.Write "                if (screen.width <= 750) {" & vbCrLf
	Response.Write "                    $('#login').animate({" & vbCrLf
	Response.Write "                        'margin-left' : -160" & vbCrLf
	Response.Write "                    }, 200, 'easeOutQuint')" & vbCrLf
	Response.Write "                } else {" & vbCrLf
	Response.Write "                    $('#login').animate({" & vbCrLf
	Response.Write "                        'margin-left' : -225" & vbCrLf
	Response.Write "                    }, 200, 'easeOutQuint')" & vbCrLf
	Response.Write "                }" & vbCrLf
	Response.Write "                $('.auth').removeClass('checking');" & vbCrLf
	Response.Write "                setTimeout(function(){" & vbCrLf
	Response.Write "                    $('#login').removeClass('checking');" & vbCrLf
	Response.Write "                }, 250)" & vbCrLf
	Response.Write "                setTimeout(function(){" & vbCrLf
	Response.Write "                    layer.msg(json['msg'], {icon: 2, anim: 6, time: 1000});" & vbCrLf
	Response.Write "                    $('#captchaimg').trigger('click');" & vbCrLf
	Response.Write "                }, 550)" & vbCrLf
	Response.Write "            } else {" & vbCrLf
	Response.Write "                if (screen.width <= 750) {" & vbCrLf
	Response.Write "                    $('#login').animate({" & vbCrLf
	Response.Write "                        'margin-left' : -160" & vbCrLf
	Response.Write "                    }, 200, 'easeOutQuint')" & vbCrLf
	Response.Write "                } else {" & vbCrLf
	Response.Write "                    $('#login').animate({" & vbCrLf
	Response.Write "                        'margin-left' : -225" & vbCrLf
	Response.Write "                    }, 200, 'easeOutQuint')" & vbCrLf
	Response.Write "                }" & vbCrLf
	Response.Write "                $('.auth').removeClass('checking');" & vbCrLf
	Response.Write "                setTimeout(function(){" & vbCrLf
	Response.Write "                    $('#login').removeClass('checking');" & vbCrLf
	Response.Write "                }, 250)" & vbCrLf
	Response.Write "                setTimeout(function(){" & vbCrLf
	Response.Write "                    layer.msg(json['msg'], {icon: 2, anim: 6, time: 1000});" & vbCrLf
	Response.Write "                }, 550)" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        })" & vbCrLf
	Response.Write "    }, 1500)" & vbCrLf
	Response.Write "})" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<!--[if lt IE 10]>" & vbCrLf
	Response.Write "</div>" & vbCrLf
	Response.Write "<![endif]-->" & vbCrLf
	Response.Write "</body>" & vbCrLf
	Response.Write "</html>" & vbCrLf
End Sub

Function ChkLogin()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim Admin_Chk, UserName, UserPassword, AdminLoginCode, GetCode, RndPassword, Rs, Sql
		Admin_Chk = True
		UserName=Code_Admin("UserName",1,20)
		UserPassword=Code_Admin("UserPassword",1,20)
		If Is_Null(Web_AdminCodes)<>"" Then
			AdminLoginCode=Code_Form("AdminLoginCode")
		End If
		GetCode=Code_Form("GetCode")
		If Is_Null(GetCode)="" Then Admin_Chk = False
		If Session("GetCode")="" Then Admin_Chk = False
		If GetCode<>CStr(Session("GetCode")) Then
			Response.Write "{""code"":2,""msg"":""\u4eb2\uff01\u9a8c\u8bc1\u7801\u9519\u8bef\u4e86\u54e6\uff01""}" & vbCrLf
			Response.End()
		End If
		If Is_Null(Web_AdminCodes)<>"" Then
			If Is_Null(AdminLoginCode)="" Then Admin_Chk = False
			If Encryptstr(AdminLoginCode)<>Web_AdminCodes Then Admin_Chk = False
		End If
		If ChkName(UserName)=False Or ChkPassword(UserPassword)=False Then Admin_Chk = False
		UserPassword=Encryptstr(UserPassword)
		Sql = "Select Top 1 * From Admin Where UserName='" & UserName & "' And Password='" & UserPassword & "' And IsOpen=True"
		Call Exe_Conn(Rs,Sql,3)
		If Rs.Eof Then
			Rs.Close
			Admin_Chk = False
		Else
			If Admin_Chk = True Then
				RndPassword = GetRndPassword(16)
				Rs("LastLoginIP") = UserTrueIP
				Rs("LastLoginTime") = Time_Type(Now(),1)
				Rs("LoginTimes") = Rs("LoginTimes") + 1
				Rs("RndPassword") = RndPassword
				Rs.Update
				Session_Set Session_For&"Admin","GongXiang_Admin"
				Session_Set Session_For&"AdminID",Rs("ID")
				Session_Set Session_For&"AdminUserName",UserName
				Session_Set Session_For&"AdminPassword",UserPassword
				Session_Set Session_For&"AdminRndPassword",RndPassword
				If Is_Null(Web_AdminCodes)<>"" Then
					Session_Set Session_For&"AdminLoginCode",Encryptstr(AdminLoginCode)
				End If
				Session_Set Session_For&"AdminGroupID",Rs("GroupID")
				Session_Set Session_For&"AdminSessionTimeout",SessionTimeout
				If Code_CLng(Trim(SessionTimeout))<>0 Then Session.Timeout = Code_CLng(Trim(SessionTimeout))
				Cookies_Set Cookies_For&"Admin","GongXiang_Admin"
				Cookies_Set Cookies_For&"AdminID",Rs("ID")
				Cookies_Set Cookies_For&"AdminUserName",UserName
				Cookies_Set Cookies_For&"AdminPassword",UserPassword
				Cookies_Set Cookies_For&"AdminRndPassword",RndPassword
				If Is_Null(Web_AdminCodes)<>"" Then
					Cookies_Set Cookies_For&"AdminLoginCode",Encryptstr(AdminLoginCode)
				End If
				Cookies_Set Cookies_For&"AdminGroupID",Rs("GroupID")
				Cookies_Set Cookies_For&"AdminSessionTimeout",SessionTimeout
				If Code_CLng(Trim(SessionTimeout))<>0 Then Response.Cookies(InstallCookies).Expires = DateAdd("n",Code_CLng(Trim(SessionTimeout)),now())
				Rs.Close
			End If
		End If
		If Admin_Chk = True Then
			Response.Write "{""code"":1,""msg"":""\u767b\u5f55\u6210\u529f\uff01"",""url"":""Admin_Index.asp""}" & vbCrLf
		Else
			If Is_Null(Web_AdminCodes)<>"" Then
				Response.Write "{""code"":0,""msg"":""\u4eb2\uff01\u7528\u6237\u540d\u6216\u8005\u5bc6\u7801\u6216\u8005\u7ba1\u7406\u8ba4\u8bc1\u7801\u6709\u8bef\uff01""}" & vbCrLf
			Else
				Response.Write "{""code"":0,""msg"":""\u4eb2\uff01\u7528\u6237\u540d\u6216\u8005\u5bc6\u7801\u6709\u8bef\uff01""}" & vbCrLf
			End If
		End If
		Response.End()
	End If
End Function

Sub Logout()
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>"&SiteName&" - "&Tit&"</title>" & vbCrLf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'>" & vbCrLf
	Response.Write "<link rel='shortcut icon' href='Images/favicon.ico' />" & vbCrLf
	Response.Write "<link href='Style/global.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='Style/font.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "</head>" & vbCrLf
	Response.Write "<body>" & vbCrLf
	If Code_CLng(Session_Get(Session_For&"AdminID"))<>0 Then Call Exec("","Update [Admin] Set LastLogoutTime='"&Time_Type(Now(),1)&"' Where ID="&Code_CLng(Session_Get(Session_For&"AdminID"))&"",0)
	Session_Delele()
	Cookies_Delele()
	Response.Write IsSuccess("您已经成功退出了！","")
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub
%>